package agent;

import fr.irit.smac.muadl.impl.j.Architecture;
import components.AdapterCreate;
import components.QuasiComponentCreate;
import components.AdapterMessage;
import components.QuasiComponentMessage;
import components.AdapterLifeCycle;
import components.QuasiComponentLifeCycle;
import components.AdapterCharacteristics;
import components.QuasiComponentCharacteristics;
import components.AdapterRepresentations;
import components.QuasiComponentRepresentations;
import components.AdapterSkills;
import components.QuasiComponentSkills;
import components.AdapterBehavior;
import components.QuasiComponentBehavior;

public class FragmentAgentMediator extends Architecture {

	private QuasiComponentCreate Create;
	private QuasiComponentMessage Message;
	private QuasiComponentLifeCycle LifeCycle;
	private QuasiComponentCharacteristics Characteristics;
	private QuasiComponentRepresentations Representations;
	private QuasiComponentSkills Skills;
	private QuasiComponentBehavior Behavior;

	protected FragmentAgentMediator(QuasiComponentCreate _Create,
			QuasiComponentMessage _Message, QuasiComponentLifeCycle _LifeCycle,
			QuasiComponentCharacteristics _Characteristics,
			QuasiComponentRepresentations _Representations,
			QuasiComponentSkills _Skills, QuasiComponentBehavior _Behavior) {

		change(_Create);

		change(_Message);

		change(_LifeCycle);

		change(_Characteristics);

		change(_Representations);

		change(_Skills);

		change(_Behavior);

	}

	public void start() {

		startComponent(Create);

		startComponent(Message);

		startComponent(LifeCycle);

		startComponent(Characteristics);

		startComponent(Representations);

		startComponent(Skills);

		startComponent(Behavior);

	}

	public void change(QuasiComponentCreate _Create) {

		setAdapter(_Create, new FragmentAgentCreateAdapter());
		Create = _Create;
	}

	public void change(QuasiComponentMessage _Message) {

		setAdapter(_Message, new FragmentAgentMessageAdapter());
		Message = _Message;
	}

	public void change(QuasiComponentLifeCycle _LifeCycle) {

		setAdapter(_LifeCycle, new FragmentAgentLifeCycleAdapter());
		LifeCycle = _LifeCycle;
	}

	public void change(QuasiComponentCharacteristics _Characteristics) {

		setAdapter(_Characteristics, new FragmentAgentCharacteristicsAdapter());
		Characteristics = _Characteristics;
	}

	public void change(QuasiComponentRepresentations _Representations) {

		setAdapter(_Representations, new FragmentAgentRepresentationsAdapter());
		Representations = _Representations;
	}

	public void change(QuasiComponentSkills _Skills) {

		setAdapter(_Skills, new FragmentAgentSkillsAdapter());
		Skills = _Skills;
	}

	public void change(QuasiComponentBehavior _Behavior) {

		setAdapter(_Behavior, new FragmentAgentBehaviorAdapter());
		Behavior = _Behavior;
	}

	public impl.AgentRef create(impl.PatternMatchingCharacteristics c,
			impl.PatternMatchingBehavior beh) {
		return this.Create.create(c, beh);
	}

	public impl.AgentRef getId() {
		return this.Create.getId();
	}

	public void die() {
		this.Create.die();
	}

	public void receive(impl.Message msg) {
		this.Message.receive(msg);
	}

	public void send(impl.AgentRef agentName, impl.Message message) {
		this.Message.send(agentName, message);
	}

	public impl.Message getMessage() {
		return this.Message.getMessage();
	}

	public impl.Message waitMessage() {
		return this.Message.waitMessage();
	}

	public void stopLifecycle() {
		this.LifeCycle.stopLifecycle();
	}

	public java.util.ArrayList<tools.MMME> getRequiredMMME() {
		return this.Characteristics.getRequiredMMME();
	}

	public java.util.ArrayList<tools.MMME> getProvidedMMME() {
		return this.Characteristics.getProvidedMMME();
	}

	public int getContextAdequacy() {
		return this.Characteristics.getContextAdequacy();
	}

	public void addRequiredMMME(tools.MMME requiredMMME) {
		this.Characteristics.addRequiredMMME(requiredMMME);
	}

	public void addProvideddMMME(tools.MMME providedMMME) {
		this.Characteristics.addProvideddMMME(providedMMME);
	}

	public void delateRequiredMMME(tools.MMME requiredMMME) {
		this.Characteristics.delateRequiredMMME(requiredMMME);
	}

	public void delateProvideddMMME(tools.MMME providedMMME) {
		this.Characteristics.delateProvideddMMME(providedMMME);
	}

	public int getCriticity() {
		return this.Representations.getCriticity();
	}

	public java.util.ArrayList<tools.MMME> getRequiredMMMECharacteristics() {
		return this.Representations.getRequiredMMMECharacteristics();
	}

	public java.util.ArrayList<tools.MMME> getProvidedMMMECharacteristics() {
		return this.Representations.getProvidedMMMECharacteristics();
	}

	public java.util.Vector<java.lang.String> getRequiredElements() {
		return this.Representations.getRequiredElements();
	}

	public java.util.Vector<impl.AgentRef> getChallengingFragments() {
		return this.Representations.getChallengingFragments();
	}

	public tools.FragmentState getMyState() {
		return this.Representations.getMyState();
	}

	public int getProcessNumber() {
		return this.Representations.getProcessNumber();
	}

	public void setMyState(tools.FragmentState state) {
		this.Representations.setMyState(state);
	}

	public void setCriticity(int stimulation) {
		this.Representations.setCriticity(stimulation);
	}

	public void setProcessNumber(int processNumber) {
		this.Representations.setProcessNumber(processNumber);
	}

	public void setRequiredMMMECharacteristics(tools.MMME mmme) {
		this.Representations.setRequiredMMMECharacteristics(mmme);
	}

	public void setProvidedMMMECharacteristics(tools.MMME mmme) {
		this.Representations.setProvidedMMMECharacteristics(mmme);
	}

	public void initRep() {
		this.Representations.initRep();
	}

	public boolean allrequiredMMMEareProducible(
			java.util.ArrayList<tools.MMME> requiredMmmes) {
		return this.Skills.allrequiredMMMEareProducible(requiredMmmes);
	}

	public boolean evalMostCriticicalProcess() {
		return this.Skills.evalMostCriticicalProcess();
	}

	public boolean oneOfProvidedMMMEisIncorporated(
			java.util.ArrayList<tools.MMME> providedMmmes) {
		return this.Skills.oneOfProvidedMMMEisIncorporated(providedMmmes);
	}

	public boolean oneOfProvidedMMMEisConcurent(
			java.util.ArrayList<tools.MMME> providedMmmes) {
		return this.Skills.oneOfProvidedMMMEisConcurent(providedMmmes);
	}

	public boolean oneOfProvidedMMMEisRedundant(
			java.util.ArrayList<tools.MMME> providedMmmes) {
		return this.Skills.oneOfProvidedMMMEisRedundant(providedMmmes);
	}

	public void Stimulate(java.util.ArrayList<tools.MMME> mmmes) {
		this.Skills.Stimulate(mmmes);
	}

	public void cycle(impl.Message msg) {
		this.Behavior.cycle(msg);
	}

	public tools.Fragment myself() {
		return this.Behavior.myself();
	}

	public void perceiveMMME() {
		this.Behavior.perceiveMMME();
	}

	public tools.FragmentState decide() {
		return this.Behavior.decide();
	}

	public void act() {
		this.Behavior.act();
	}

	public void sendChallenger() {
		this.Behavior.sendChallenger();
	}

	public void sendConcurrency() {
		this.Behavior.sendConcurrency();
	}

	public void sendStimulation() {
		this.Behavior.sendStimulation();
	}

	private class FragmentAgentCreateAdapter implements AdapterCreate {

		public void stopLifecycle() {
			FragmentAgentMediator.this.stopLifecycle();
		}

	}

	private class FragmentAgentMessageAdapter implements AdapterMessage {

	}

	private class FragmentAgentLifeCycleAdapter implements AdapterLifeCycle {

		public void cycle(impl.Message arg0) {
			FragmentAgentMediator.this.cycle(arg0);
		}

		public impl.Message getMessage() {
			return FragmentAgentMediator.this.getMessage();
		}

		public impl.Message waitMessage() {
			return FragmentAgentMediator.this.waitMessage();
		}

	}

	private class FragmentAgentCharacteristicsAdapter
			implements
				AdapterCharacteristics {

		public impl.AgentRef getId() {
			return FragmentAgentMediator.this.getId();
		}

	}

	private class FragmentAgentRepresentationsAdapter
			implements
				AdapterRepresentations {

		public java.util.ArrayList<tools.MMME> getRequiredMMME() {
			return FragmentAgentMediator.this.getRequiredMMME();
		}

		public java.util.ArrayList<tools.MMME> getProvidedMMME() {
			return FragmentAgentMediator.this.getProvidedMMME();
		}

		public impl.AgentRef getId() {
			return FragmentAgentMediator.this.getId();
		}

		public int getContextAdequacy() {
			return FragmentAgentMediator.this.getContextAdequacy();
		}

	}

	private class FragmentAgentSkillsAdapter implements AdapterSkills {

		public java.util.ArrayList<tools.MMME> getRequiredMMME() {
			return FragmentAgentMediator.this.getRequiredMMME();
		}

		public java.util.ArrayList<tools.MMME> getProvidedMMME() {
			return FragmentAgentMediator.this.getProvidedMMME();
		}

		public int getCriticity() {
			return FragmentAgentMediator.this.getCriticity();
		}

		public int getProcessNumber() {
			return FragmentAgentMediator.this.getProcessNumber();
		}

		public impl.AgentRef getId() {
			return FragmentAgentMediator.this.getId();
		}

	}

	private class FragmentAgentBehaviorAdapter implements AdapterBehavior {

		public int getCriticity() {
			return FragmentAgentMediator.this.getCriticity();
		}

		public int getProcessNumber() {
			return FragmentAgentMediator.this.getProcessNumber();
		}

		public java.util.ArrayList<tools.MMME> getRequiredMMMECharacteristics() {
			return FragmentAgentMediator.this.getRequiredMMMECharacteristics();
		}

		public java.util.ArrayList<tools.MMME> getProvidedMMMECharacteristics() {
			return FragmentAgentMediator.this.getProvidedMMMECharacteristics();
		}

		public java.util.Vector<impl.AgentRef> getChallengingFragments() {
			return FragmentAgentMediator.this.getChallengingFragments();
		}

		public java.util.Vector<java.lang.String> getRequiredElements() {
			return FragmentAgentMediator.this.getRequiredElements();
		}

		public tools.FragmentState getMyState() {
			return FragmentAgentMediator.this.getMyState();
		}

		public void setMyState(tools.FragmentState arg0) {
			FragmentAgentMediator.this.setMyState(arg0);
		}

		public void setCriticity(int arg0) {
			FragmentAgentMediator.this.setCriticity(arg0);
		}

		public void setProcessNumber(int arg0) {
			FragmentAgentMediator.this.setProcessNumber(arg0);
		}

		public void setRequiredMMMECharacteristics(tools.MMME arg0) {
			FragmentAgentMediator.this.setRequiredMMMECharacteristics(arg0);
		}

		public void setProvidedMMMECharacteristics(tools.MMME arg0) {
			FragmentAgentMediator.this.setProvidedMMMECharacteristics(arg0);
		}

		public void initRep() {
			FragmentAgentMediator.this.initRep();
		}

		public java.util.ArrayList<tools.MMME> getProvidedMMME() {
			return FragmentAgentMediator.this.getProvidedMMME();
		}

		public java.util.ArrayList<tools.MMME> getRequiredMMME() {
			return FragmentAgentMediator.this.getRequiredMMME();
		}

		public boolean allrequiredMMMEareProducible(
				java.util.ArrayList<tools.MMME> arg0) {
			return FragmentAgentMediator.this
					.allrequiredMMMEareProducible(arg0);
		}

		public boolean evalMostCriticicalProcess() {
			return FragmentAgentMediator.this.evalMostCriticicalProcess();
		}

		public boolean oneOfProvidedMMMEisIncorporated(
				java.util.ArrayList<tools.MMME> arg0) {
			return FragmentAgentMediator.this
					.oneOfProvidedMMMEisIncorporated(arg0);
		}

		public boolean oneOfProvidedMMMEisConcurent(
				java.util.ArrayList<tools.MMME> arg0) {
			return FragmentAgentMediator.this
					.oneOfProvidedMMMEisConcurent(arg0);
		}

		public boolean oneOfProvidedMMMEisRedundant(
				java.util.ArrayList<tools.MMME> arg0) {
			return FragmentAgentMediator.this
					.oneOfProvidedMMMEisRedundant(arg0);
		}

		public void Stimulate(java.util.ArrayList<tools.MMME> arg0) {
			FragmentAgentMediator.this.Stimulate(arg0);
		}

		public void send(impl.AgentRef arg0, impl.Message arg1) {
			FragmentAgentMediator.this.send(arg0, arg1);
		}

		public impl.AgentRef create(impl.PatternMatchingCharacteristics arg0,
				impl.PatternMatchingBehavior arg1) {
			return FragmentAgentMediator.this.create(arg0, arg1);
		}

		public impl.AgentRef getId() {
			return FragmentAgentMediator.this.getId();
		}

		public void die() {
			FragmentAgentMediator.this.die();
		}

	}

}
